{extend name="template/base" /}
{block name="nav"}{/block}
{block name="content"}
<div class="page-container">
    <div class="row cl">
        
        <div class="formControls col-xs-6 col-sm-6 skin-minimal"> 
            {volist name="info" id="v"}

            <div class="radio-box">
                    <input type="checkbox" class="boxs"  name="id" <?php if($v['is_use'] == '2')echo "checked";?> value="{$v['id']}">
                <label> {$v['pay_name']}({$v['remark']})</label>
            </div>
            {/volist}
        </div>
        <div class="col-xs-3 col-sm-3"><a class="btn btn-primary radius" href="javascript:;" onclick="editPayment(this)" >确定</a></div>
    </div>
    
</div>
{/block}
{block name="script"}
<script type="text/javascript" src="__LIB__/Validform/5.3.2/Validform.min.js"></script>
<script>
//修改支付方式
function editPayment(obj){
    var goods_id=[];
    var arr = '';
    if($("input[name='id']:checked").each(function(){goods_id.push($(this).val());})){
        arr = goods_id.join(',');
    }
    layer.confirm('确定？',{title: '提示'},function(index){
        $.post("{:url('Pub/editPayment')}", {ids:arr},
        function(data){
            if(data.msg == 1000){
                parent.layer.msg('成功', {icon: 1, time: 2000});
                window.location.href=window.location.href;
            }else{
                layer.msg('失败!',{icon: 5,time:1000});
            }
        });
    });
}
    $(function () {
        $('.skin-minimal input').iCheck({
            checkboxClass: 'icheckbox-blue',
            radioClass: 'iradio-blue',
            increaseArea: '20%'
        });
        $("#form").Validform({
            tiptype:2,
            ajaxPost:true,
            showAllError:true,
            callback:function(ret){
                ajax_progress(ret);
            }
        });
    })
</script>
{/block}